from pymongo import *


class Pymongo(object):
    def __init__(self, host='localhost', port=27017, db='mydb', set='myset'):
        self.client = MongoClient(host, port)
        self.db = self.client.db
        self.mySet = self.db.set
        self.__msg = '[%s:%d],database:%s,collection:%s'%(host,port,db,set)

    def __str__(self):
        return self.__msg

if __name__ == '__main__':
    p = Pymongo()
    print(p)